package com.ruoyi.petrol.controller;

import com.ruoyi.petrol.service.IChePetrolInfoService;
import com.ruoyi.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName ChePetrolInfoController
 * @Description TODO
 * @Author fyd
 * @Date 2024年06月12日 20:51
 * @Version 1.0
 */
@RestController
@RequestMapping("/petrolInfo")
@CrossOrigin
public class ChePetrolInfoController {
    @Autowired
    private IChePetrolInfoService petrolInfoService;
    @GetMapping("/getP")
    public Result getPhoto(Long id){
        Map map = new HashMap();
        map.put("id",id);
        Map<Object, Object> map1 = petrolInfoService.selectPhotoById(map);
        return Result.success(map1);
    }

    @GetMapping("/getTP")
    public Result getTypePrice(Long id){
        Map map = new HashMap();
        map.put("id",id);
        Map<Object, Object> map2 = petrolInfoService.selectTypePriceById(map);
        return Result.success(map2);
    }

}
